<?php
namespace app\common\validate;

use think\Validate;

class FormValidate extends Validate
{
    // 验证规则
    protected $rule = [
        'form_name|表单名' => 'require',
        'table_name|表名' => 'require|unique:form',
        'success_msg'   => 'require',
    ];
    //验证场景
    protected $scene = [
        'add'  => ['form_name', 'table_name', 'success_msg'],
        'edit' => ['form_name', 'success_msg'],
    ];
}